<template>
  <div class="pagination-box-ssa">
    <div :style="`visibility:${zsum !== false?'visible':'hidden'};`">总计： {{ zsum }}</div>
    <div style="text-align: right">
      <el-pagination
        :current-page="page"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        :pager-count="pagerCount"
        background
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: "PaginAtion",
  props: {
    "page": {
      type: Number,
      default() {
        return 1
      }
    },
    "pageSizes": {
      type: Array,
      default() {
        return [5, 10, 15, 20]
      }
    },
    "pageSize": {
      type: Number,
      default() {
        return 10
      }
    },
    "pagerCount": {
      type: Number,
      default() {
        return 7
      }
    },
    "total": {
      type: Number,
      default() {
        return 999
      }
    },
    zsum: {
      type: [Number,String,Boolean],
      default() {
        return false
      }
    }
  },
  methods: {
    handleSizeChange(e) {
      this.$emit("handleSizeChange", e);
    },
    handleCurrentChange(e) {
      this.$emit("handleCurrentChange", e);
    }
  },
};
</script>

<style scoped>
.pagination-box-ssa{
  display: flex;
  justify-content: space-between;
  line-height: 32px;
}
</style>
